--焰环成狱
local yanhuanchengyu = fk.CreateSkill {
    name = "mcdh_yanhuanchengyu",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

yanhuanchengyu:addEffect(fk.PreDamage,{
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(self) and target and player:getMark("mcdh_charge") >= 3
    end,
    on_cost = function(self, event, target, player, data)
        local room = player.room
        if room:askForSkillInvoke(player, self.name, nil, "#mcdh_yanhuanchengyu-invoke:" .. target.id .. ":" .. data.to.id) then
            lib.mcdh_charge(player, -3)
            return true
        end
    end,
    on_use = function(self, event, target, player, data)
        data.damageType = fk.FireDamage
    end
})

Fk:loadTranslationTable {
    ["mcdh_yanhuanchengyu"] = "焰环成狱",
    [":mcdh_yanhuanchengyu"] = "『焰环成狱』<br>蓄力技(3)。一名角色即将造成伤害时，你可以将此伤害改为火焰伤害。",
    ["#mcdh_yanhuanchengyu-invoke"] = "焰环成狱：将 %src 对 %dest 即将造成的伤害改为火焰伤害"
}

return yanhuanchengyu